package com.foredu.fiqs.service;

import java.util.List;

import org.springframework.security.core.userdetails.UserDetailsService;

import com.foredu.fiqs.domain.Clazz;
import com.foredu.fiqs.domain.Department;
import com.foredu.fiqs.domain.EmpPost;
import com.foredu.fiqs.domain.EmpTitle;
import com.foredu.fiqs.domain.EmpType;
import com.foredu.fiqs.domain.Employee;
import com.foredu.fiqs.domain.Role;
import com.foredu.fiqs.domain.SalaryItemDetailType;
import com.foredu.fiqs.domain.SalaryItemType;
import com.foredu.fiqs.domain.Student;
import com.foredu.fiqs.domain.Term;
import com.foredu.fiqs.domain.Teacher;
import com.foredu.fiqs.domain.User;

public interface IManagementService extends UserDetailsService {

	/*
	 * Role对象的事务处理
	 */
	void saveRole(Role role);

	void deleteRoleById(int id);

	void updateRole(Role role);

	List<Role> findRoles();

	Role findRoleById(int id);

	Role findRoleByName(String name);

	/*
	 * User对象的事务处理
	 */
	void saveUser(User user);

	void deleteUserById(int id);

	void updateUser(User user);

	List<User> findUsers();

	User findUserById(int id);

	User findUserByUsername(String username);

	List<User> findUsersByRoleName(String roleName);

	/*
	 * Department对象的事务处理
	 */
	void saveDepartment(Department department);

	void deleteDepartmentById(int id);

	void updateDepartment(Department department);

	List<Department> findDepartments();

	Department findDepartmentById(int id);

	Department findDepartmentByDeptId(String deptId);

	/*
	 * Clazz对象的事务处理
	 */
	Integer saveClazz(Clazz clazz);

	void deleteClazzById(int id);

	void updateClazz(Clazz clazz);

	List<Clazz> findClazzs();

	Clazz findClazzById(int id);

	/*
	 * Term对象的事务处理
	 */
	void saveTerm(Term term);

	void deleteTermById(int id);

	void updateTerm(Term term);

	List<Term> findTerms();

	Term findTermById(int id);

	// 获得当前学期对象
	Term findTermOfNow();

	// 通过学年度开始年和结束年以及学期序号查找学期对象
	Term findTermByTimeAndOrder(int startYear, int endYear, int order);

	/*
	 * Teacher对象的事务处理
	 */
	void saveTeacher(Teacher teacher);

	void deleteTeacherById(int id);

	void updateTeacher(Teacher teacher);

	List<Teacher> findTeachers();

	List<Teacher> findTeachersOfDept(Department dept);

	Teacher findTeacherById(int id);

	Teacher findTeacherByUserId(int id);

	Teacher findTeacherByTeachId(String id);

	/*
	 * Student对象的事务处理
	 */
	void saveStudent(Student student);

	void deleteStudentById(int id);

	void updateStudent(Student student);

	List<Student> findStudents();

	Student findStudentById(int id);

	Clazz findClazzByClazzId(String clazzId);

	Student findStudentByStuId(String id);
	
	/*
	 * EmpTitle对象的事务处理
	 */
	void saveEmpTitle(EmpTitle empTitle);

	void deleteEmpTitleById(int id);

	void updateEmpTitle(EmpTitle empTitle);

	List<EmpTitle> findEmpTitle();

	EmpTitle findEmpTitleById(int id);

	EmpTitle findEmpTitleByName(String name);
	/*
	 * 职务类EmpPost对象的事务处理
	 */
	void saveEmpPost(EmpPost empPost);

	void deleteEmpPostById(int id);

	void updateEmpPost(EmpPost empPost);

	List<EmpPost> findEmpPost();

	EmpPost findEmpPostById(int id);
	
	/*
	 * 职务类EmpType对象的事务处理
	 */
	void saveEmpType(EmpType empType);

	void deleteEmpTypeById(int id);

	void updateEmpType(EmpType empType);

	List<EmpType> findempType();

	EmpType findEmpTypeById(int id);
	
	/*
	 * 工资条目类型管理SalaryItemType对象的事务处理
	 */
	void saveSalaryItemType(SalaryItemType type);

	void deleteSalaryItemType(int id);

	void updateSalaryItemType(SalaryItemType type);

	List<SalaryItemType> findSalaryItemType();

	SalaryItemType findSalaryItemTypeById(int id);
	
	/*
	 * 教职工Employee对象的事务处理
	 */
	void saveEmployee(Employee employee);

	void deleteEmployeeById(int id);

	void updateEmployee(Employee employee);

	List<Employee> findEmployee();

	Employee findempIdByEmpId(String empId);

	/*
	 * 工资条目明细类型管理SalaryItemDetailType对象的事务处理
	 */
	void saveSalaryItemDetailType(SalaryItemDetailType type);

	void deleteSalaryItemDetailType(int id);

	void updateSalaryItemDetailType(SalaryItemDetailType type);

	List<SalaryItemDetailType> findSalaryItemDetailType();

	SalaryItemDetailType findSalaryItemDetailTypeById(int id);
	
	List<SalaryItemDetailType> findDetailTypeOfSalaryItemType(SalaryItemType type);
}
